#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableUnionLevDao:DaoBase<TableUnionLev>
    {
        public override string GetFileName()
        {
            return "TableUnionLev.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableUnionLev>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableUnionLev model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.level)) UnityEngine.Debug.LogError("数据表id重复:TableUnionLev->id: " + model.level);
            #endif
            cachePrimaryInt[model.level] = model;
        }
        protected override TableUnionLev ParseRowData(string[] rowData)
        {
            TableUnionLev data = new TableUnionLev();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.level = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.maxMemberNum = int.Parse(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.perDayExp = int.Parse(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.maxBuildingUpgradeNum = int.Parse(rowData[3]);
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.maxUnionTaskNum = int.Parse(rowData[4]);
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.maintainFund = string.Intern(rowData[5]);
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.unionPorpAdd = rowData[6];
            }
            if (!string.IsNullOrEmpty(rowData[7]))
            {
                data.unionPropPerAdd = rowData[7];
            }
            return data;
        }
    }
}
